<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });

//用户添加路由
Route::get('user/add','UserController@add');


Route::post('user/store','UserController@store');

Route::get('user/index','UserController@index');

Route::get('user/edit/{id}','UserController@edit');
Route::post('user/update','UserController@update');
Route::get('user/del/{id}','UserController@destroy');





Route::group(['prefix'=>'admin','namespace'=>'Admin'],function(){
    //后台登录路由
    Route::get('login','LoginController@login');
    //验证码
    Route::get('code','LoginController@code');
    //处理登录
    Route::post('dologin','LoginController@doLogin');
    //加密算法
    Route::get('jiami','LoginController@jiami');

});



Route::group(['prefix'=>'admin','namespace'=>'Admin','middleware'=>'isLogin'],function(){
    Route::get('index','LoginController@adminIndex');
    Route::get('welcome','LoginController@welcome');
    //后台退出登录
    Route::get('logout','LoginController@logout');

    //后台用户模块相关路由
    Route::resource('user','UserController');


});
